<template>
  <div id="bottom-bar">
    <div class="center-wrapper">
      <template v-if="!isPhone">
        <div class="left">
          <!-- <ul>
            <li class="left-item">Copyright © 2022 AOTU</li>
            <li class="left-item">Our Companies</li>
            <li class="left-item">Terms & Conditions</li>
            <li class="left-item">Contact Us</li>
            <li class="left-item">About Us</li>
          </ul> -->
          <span class="left-item"
            >Copyright © 2022 Jupiter Co., Ltd. All Rights Reserved.
          </span>
        </div>
        <div class="right">
          <!-- <div class="right-top">Share to</div>
          <div class="right-bottom">
            <ul>
              <li class="right-bottom-item"></li>
              <li class="right-bottom-item"></li>
              <li class="right-bottom-item"></li>
            </ul>
          </div> -->
          <span class="right-item">aotunft@gmail.com</span>
        </div>
      </template>

      <template v-else>
        <div class="m-left">aotunft@gmail.com</div>
        <div class="m-right" @click="gotoPage('QA')">
          <img v-if="isPhone" :src="images.icon" />
          <span>Q&A</span>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
// --- utils ---
import { isPhone } from "@/utils";

export default {
  name: "BottomBar",
  data() {
    return {
      // static
      images: {
        icon: require("@/assets/images/bottombar/bottombar_icon.png"),
      },
      // flag
      isPhone: false,
    };
  },
  methods: {
    // ========== goto ==========
    gotoPage(pageType) {
      switch (pageType) {
        case "Email":
          // window.open("https://aotunft@gmail.com", "_blank");
          break;
        case "QA":
          window.open("https://dior-bob.gitbook.io/aotuworld-1", "_blank");
          break;
        default:
          break;
      }
    },
  },
  mounted() {
    isPhone() ? (this.isPhone = true) : (this.isPhone = false);
  },
};
</script>

<style lang="less" scoped>
#bottom-bar {
  position: relative;
  width: 100%;
  height: 200px;
  background-image: url("../assets/images/bottombar/bottombar_background.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  z-index: 4;
  margin-top: -21px;

  ul,
  li {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  ul {
    display: flex;
    width: 100%;
    height: 100%;
  }

  .center-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1200px;
    height: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding-top: 21px;

    .left {
      .left-item {
        font-size: 16px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #ffffff;
        line-height: 16px;
        opacity: 0.5;
        margin-right: 35px;
        // cursor: pointer;
      }
      .left-item:first-child {
        margin-right: 60px;
        cursor: unset;
      }
    }

    .right {
      display: flex;
      flex-direction: column;

      .right-top {
        font-size: 16px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #ffffff;
        line-height: 15px;
        opacity: 0.5;
      }
      .right-bottom {
        margin-top: 21px;

        .right-bottom-item {
          width: 20px;
          height: 20px;
          background: #ffffff;
          margin-right: 24px;
        }
      }

      .right-item {
        font-size: 16px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #ffffff;
        line-height: 16px;
        opacity: 0.5;
      }
    }
  }
}

@media screen and (max-width: 768px) {
  #bottom-bar {
    height: 16vw;
    background: #222222;
    margin: 0;

    .center-wrapper {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      margin: 0;
      box-sizing: border-box;
      padding: 0 4vw;

      .m-left {
        font-size: 3.2vw;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.5);
        line-height: 3.2vw;
      }

      .m-right {
        display: flex;
        align-items: center;

        span {
          font-size: 3.2vw;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: rgba(255, 255, 255, 0.5);
          line-height: 3.2vw;
        }

        img {
          width: 3.7333vw;
          margin-right: 2.6667vw;
        }
      }
    }
  }
}
</style>
